+git-annex (10.20250930) UNRELEASED; urgency=medium
+
+ * Support ssh remotes with '#' and '?' in the path to the repository,
+ the same way git does.
+
+ -- Joey Hess <id@joeyh.name> Mon, 20 Oct 2025 15:22:30 -0400
+
git-annex (10.20250929) upstream; urgency=medium
* enableremote: Allow type= to be provided when it does not change the
relPath,
) where
-import Network.URI (uriPath, uriScheme, unEscapeString)
+import Network.URI (uriPath, uriScheme, uriQuery, uriFragment, unEscapeString)
#ifndef mingw32_HOST_OS
import System.Posix.Files
#endif
- it's the gitdir, and for URL repositories, is the path on the remote
- host. -}
repoPath :: Repo -> OsPath
-repoPath Repo { location = Url u } = toOsPath $ unEscapeString $ uriPath u
+repoPath Repo { location = Url u } = toOsPath $ unEscapeString $
+ -- git allows the path of a ssh url to include both '?' and '#',
+ -- and treats them as part of the path
+ uriPath u ++ uriQuery u ++ uriFragment u
repoPath Repo { location = Local { worktree = Just d } } = d
repoPath Repo { location = Local { gitdir = d } } = d
repoPath Repo { location = LocalUnknown dir } = dir
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2025-10-20T19:16:15Z"
+ content="""
+Also affected is '?' in the path. It's somewhat surprising to me that git
+treats these parts of an url as path components, but
+not too surprising, as git's definition of "url" is pretty loose.
+
+Fixed git-annex to follow suite.
+"""]]